package com.neu.config;

import com.neu.interceptor.LogInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class MyMyWebMvcConfigurer implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {

        //addPathPatterns     代表要拦截什么路径
        //excludePathPatterns 代表不拦截怎样的路径
        registry.addInterceptor(new LogInterceptor()).addPathPatterns("/**").excludePathPatterns("/users/**");

    }
}
